package com.mall.goods.controller;

import com.mall.commons.utils.CommonResult;
import com.mall.goods.service.PmsProductAttributeCategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/productAttribute/category")
public class PmsProductAttributeCategoryController {
    @Autowired(required = false)
    private PmsProductAttributeCategoryService pmsProductAttributeCategoryService;

    /**
     * 分页获取所有商品属性分类
     *
     * @param pageNum
     * @param pageSize
     * @return
     */
    @GetMapping("/list")
    public CommonResult list(@RequestParam(defaultValue = "1") Integer pageNum,
                             @RequestParam(defaultValue = "5") Integer pageSize) {
        return CommonResult.success(pmsProductAttributeCategoryService.list(pageNum, pageSize));
    }


}
